package org.xhnews.services;

import java.util.Timer;
import java.util.TimerTask;

import org.xhnews.bo.ForwardBo;
import org.xhnews.preferences.Preferences;

public class UpdateContactService{
	Timer timer = new Timer();

	public void start() {
		timer.schedule(new UpdateContactTask(), 20000, 1000*60*Preferences.contact_update_interval);
	}

	public void stop() {
		timer.cancel();
	}

	class UpdateContactTask extends TimerTask {
		public void run() {
			ForwardBo.updateContacts();
		}
	}
}
